<!doctype html>
<html lang="zh-CN">
<head>
#parse("common/head.html")
<link rel="icon" href="icon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="icon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="$!{form.domain}/css/index.css">
<link href="$!{form.domain}/css/style.css" type="text/css" rel="stylesheet" />
<link href="$!{form.domain}/css/newindex.css" type="text/css" rel="stylesheet" />
<link href="$!{form.domain}/css/global.css" type="text/css" rel="stylesheet" />
<link href="$!{form.domain}/css/community.css" type="text/css" rel="stylesheet" />
<link href="$!{form.domain}/css/kczx.css" type="text/css" rel="stylesheet" >
<script>
var ShareTip = function(){ }  ;
//分享到腾讯微博  
ShareTip.prototype.sharetoqq=function(content,url,picurl)  
{  
 var shareqqstring='http://v.t.qq.com/share/share.php?title='+encodeURIComponent(content)+'&url='+encodeURIComponent(url)+'&pic='+encodeURIComponent(picurl);  
 window.open(shareqqstring,'height=100,width=100,top=100,left=100');  
}  
//分享到新浪微博  
ShareTip.prototype.sharetosina=function(title,url,picurl)  
{  
 var sharesinastring='http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(title)+'&url='+encodeURIComponent(url)+'&content=utf-8&sourceUrl='+encodeURIComponent(url)+'&pic='+encodeURIComponent(picurl);  
 window.open(sharesinastring,'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');  
   
}  
//分享到QQ空间  
ShareTip.prototype.sharetoqqzone=function(title,url,picurl)  
{  
 var shareqqzonestring='http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?summary='+encodeURIComponent(title)+'&url='+encodeURIComponent(url)+'&pics='+encodeURIComponent(picurl);  
 window.open(shareqqzonestring,'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');  
}  
 
//分享到QQ空间  
ShareTip.prototype.sharetorenren=function(title,url,picurl)  
{  
 var shareqqzonestring='http://share.renren.com/share/buttonshare.do?title='+encodeURIComponent(title)+'&link='+encodeURIComponent(url) ;  
 window.open(shareqqzonestring,'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');  
}  
</script>
</head>
<body>
#parse("common/header.html")
<div class="c-container">
  <div class="topicalbanner">
    <div class="topical"> 
      <!--页面面包屑导航 开始-->
      <div class="topicaltitle"> <a href='$!{form.domain}/' target="_self">首页</a>> <a href='$!{form.domain}/course/list?type=${form.course.courseTp}' target="_self">#if($!{form.course.courseOnlinetp}==2)现场#else视频课程#end</a>> <span class="color4">$!{form.course.courseName}</span> </div>
      <!--页面面包屑导航 结束--> 
      
      <!-- 课程预览头部区域 开始 -->
      <div class="bannerfix1 clearfix">
        <div class="bannervideo">
          <div class="videoimg"> <span ><img src="$!{form.getImageUrl($!{form.course.coursePic})}"/></span> </div>
          <div class="shareimg clearfix"> <span>
            <div class="bdsharebuttonbox" data-tag="share_1"> <a href="#" class="bds_more" data-cmd="more"> </a> <a title="分享到QQ空间" href="#" class="bds_qzone" data-cmd="qzone"> </a> <a title="分享到新浪微博" href="#" class="bds_tsina" data-cmd="tsina"> </a> <a title="分享到腾讯微博" href="#" class="bds_tqq" data-cmd="tqq"> </a> <a title="分享到人人网" href="#" class="bds_renren" data-cmd="renren"> </a> <a title="分享到微信" href="#" class="bds_weixin" data-cmd="weixin"> </a> </div>
            </span> </div>
        </div>
        <div class="videocontent">
          <div class="title" title="$!{form.course.courseName}" >$!{form.course.courseName}</div>
          <div class="courseabstract" title="">$!{form.subAndFilerHtml($!{form.course.content},150)}</div>
          <div class="courseblock courseinform">
            <div class="inform clearfix">
              <div class="informleft"> <span class="color80">课&nbsp;&nbsp;&nbsp;&nbsp;程：</span>$!{form.course.courseSize}门 </div>
              <div class="informleft"> <span class="color80">讲&nbsp;&nbsp;&nbsp;&nbsp;师：</span><a href='$!{form.getUserUrl($!{form.course.courseTeacherid})}' class='' target='_blank' title='中建政研专家委员'>$!{form.course.courseTeachernm}</a> </div>
            </div>
            <div class="inform clearfix">
              <div class="informleft"> <span class="color80">课&nbsp;&nbsp;&nbsp;&nbsp;时：</span>$!{form.course.courseTimes}课</div>
              <div class="informleft"> <span class="color80">发布日期：</span>$dateTool.format("yyyy-MM-dd",$!{form.course.coursePdt})</div>
            </div>
          </div>
          <div class="pricediv"> <span class="fontsize24 color9">¥$!{form.getPrice($!{form.course.curPrice})}</span> <span class="costprice"> ¥$!{form.getPrice($!{form.course.curPrice})}</span> </div>
          <form id="course_submit" method="get" action="$!{form.domain}/cart/add?type=$!{form.type}" >
          <div class="buynow clearfix">
            <div class="floatleft">
              #if(  $!{form.course.courseClass}!=1 &&  $!{form.course.courseOnlinetp}!=2 )
                #if($!{form.buyFlag})
                  <input type="button" class="shopcartbtn" value="已购买" />
                #else
                  <input type="button" class="buynowbtn" value="立即购买" onclick="addCart('$!{form.course.courseId}', 1);"/>
                  <input type="button" id="shopcartbtn" class="shopcartbtn" value="加入购课车" />
                #end
              #elseif($!{form.course.courseOnlinetp}==2)
                <input type="button" id="sign_up" class="buynowbtn" onclick="goToSignUp('$!{form.course.courseId}')" value="立即报名" />
              #elseif($!{form.course.courseClass}==1)
                <input type="button" class="buynowbtn" onclick="nowStudy('$!{form.course.courseId}')" value="马上学习" />
              #end
            </div>
          </div>
          </form>
          <div class="kczx_son_divbodytm04">
            <div class="kczx_son_divbodytm0401">已有<span class="color9">$!{form.count.courseBuycnt}</span>人购买 </div>
             <div class="kczx_son_divbodytm0402">
              <div class="kszn_son_m0200">分享到：</div>
				  <a href="#" onclick="new ShareTip().sharetosina('$!{form.course.courseName}','$!{form.domain}/course/detail/$!{form.courses.courseId}','$!{form.getImageUrl($!{form.course.coursePic})}');">
					  <div  class="kszn_son_m0201 mt8"> 
					  </div>
				  </a>
				  <a href="#" onclick="new ShareTip().sharetoqqzone('$!{form.course.courseName}','$!{form.domain}/course/detail/$!{form.courses.courseId}','$!{form.getImageUrl($!{form.course.coursePic})}');">
					<div class="kszn_son_m0202 mt8"> </div>
				  </a> 
				  <a href="#" onclick="new ShareTip().sharetoqq('$!{form.course.courseName}','$!{form.domain}/course/detail/$!{form.courses.courseId}','$!{form.getImageUrl($!{form.course.coursePic})}');">
					<div class="kszn_son_m0203 mt8"> </div>
				  </a>
				  <a href="#"  onclick="new ShareTip().sharetorenren('$!{form.course.courseName}','$!{form.domain}/course/detail/$!{form.courses.courseId}','$!{form.getImageUrl($!{form.course.coursePic})}');">
					<div class="kszn_son_m0204 mt8"> </div>
				  </a> 
			  </div>
          </div>
          <!--阅读的权限条件，目前只用于销售中课程的会员权限的描述。--> 
        </div>
      </div>
      <!-- 课程预览头部区域 结束 --> 
    </div>
  </div>
  <div class="maincontent clearfix">
    <div class="information">
      <div class="informcontent">
        <div class="informtitle_blue clearfix">
          <div class="contentnavbg" id="courseContentNav">
            <div class="informtitlediv">
              <div class="navitem navitemhover" id="course-brieft">课程介绍</div>
              <div class="navitem" id="course-listt">#if($!{form.course.courseOnlinetp}==2)讲师介绍#else课程列表#end</div>
              <div class="navitem" id="course-recordt">购买记录</div>
            </div>
          </div>
        </div>
        <div class="intablecontentdiv"> 
          <!--课程简介-->
          <div class="courseblock courseinform courseheight" id="course-brief" >
            <div class="reachtextbody">
              $!{form.course.content}
            </div>
          </div>
          <!--课程简介 end--> 
          <!--课程列表-->
          #if($!{form.course.courseSubject} && $!{form.course.courseSubject}==2)
          <div class="containerLeft courseheight mt30" id="course-list" style="display:none;">
            <div class="item">
              <div class="body clearfix">
               #foreach($data in $!form.cList)
                <div class="course-item #if($velocityCount==1) first #end"> <a href="$!{form.domain}/course/detail/$!{data.courseId}" title=""  target="_blank"  class="course-img"> <img class="topicimg" src="$!{form.getImageUrl($!{data.coursePic})}"/> </a>
                  <div class="course-msg">
                    <p class="nowrap ellipsis"> <a href="$!{form.domain}/course/detail/$!{data.courseId}" title="" target="_blank" class="fontsize14 link03">$!{data.courseName}</a> </p>
                    <p class="fontsize14"> <span class="price free"> ￥$!{form.getPrice($!{data.curPrice})} </span> <span class="colord seperator">|</span> <span class="color9">$!{data.courseStudyNum}人学习</span> </p>
                  </div>
                </div>
                #end
              </div>
            </div>
          </div>
          #elseif($!{form.course.courseSubject}==1 || $!{form.course.courseClass}==2 || $!{form.course.courseOnlinetp}==1)
          <div class="courseblock  lesslist" id="course-list" style="display:none;">
            <div class="coursecontent"> 
              <div class="classhourlist1">
                <div class="body">
                  #foreach($data in $!form.courseCategoryList)
                  <div class="classrow clearfix classrow-bg">
                    <div class="cols1"> 课时$velocityCount </div>
                    <div class="cols2"> </div>
                    <div class="cols3 clearfix hand">
                      <div class="left clearfix"> <span class="fontsize1 floatleft"><a class="link3"  onclick="clic();" title="$!{data.categoryName}">$!{data.categoryName}...</a></span> <span class="fontsize0 floatright color5">#if($!{data.courseTimes}>0) $!{data.courseTimes}#end </span> </div>
                      <div class="right"> </div>
                    </div>
                  </div>
                  #end
                </div>
                </div>
              </div>
             </div>
            #elseif($!{form.course.courseOnlinetp}==2)
            <div class="courseblock courseinform courseheight" id="course-list" style="display:none;">
              <div class="reachtextbody">
                <p>$!{form.teacher.contend}</p>
              </div>
            </div>
            #end
          <!--课程列表 end--> 
          
          <!--购买记录-->
          <div class="courseblock courseheight courseheight" id="course-record" style="display:none;">
            <div class="blockbody">
              <div class="buyrecords">
                <div class="recordtitle clearfix">
                  <div class="col1">报名/购买者</div>
                  <div class="col2"></div>
                  <div class="col3"></div>
                  <div class="col4">购买时间</div>
                </div>
                <div class="recorditemdiv" id="divCourseBuy">
                  #foreach($data in $!form.cList)
                  <div class="recorditem clearfix">
                    <div class="col1"> <span><img src="$!{form.getImageUrl($!{data.userHimg})}"/></span> <span>$!{data.userRnm}</span> </div>
                    <div class="col2"></div>
                    <div class="col3"></div>
                    <div class="col4">$dateTool.format("yyyy-MM-dd",$!{data.commitDt})</div>
                  </div>
                  #end
                </div>
              </div>
            </div>
          </div>
          <!--购买记录 end--> 
        </div>
      </div>
    </div>
    <div class="kczx_divr">
      <!--讲师介绍-->
      #if($!{form.course.courseClass}==1 || $!{form.course.courseOnlinetp}==2)
      <div class="kczx_dynamic mb10 mt11">
        <div class="kczx_title kczx_titlel">讲师介绍</div>
        <div class="jsjs" > <a href="$!{form.getUserUrl($!{form.teacher.userId})}"><img src="$!{form.getImageUrl($!{form.teacher.userHimg})}" /></a>
          <div class="teac-txt"> <a  href='$!{form.getUserUrl($!{form.teacher.userId})}' target="_blank" class="olink10 hand">$!{form.teacher.userRnm}</a>
            <div class="color5">课程&nbsp;&nbsp;70</div>
            <div class="color5">粉丝&nbsp;&nbsp;$!{form.teacher.fenCnt}</div>
          </div>
        </div>
      </div>
      #end
      <!--讲师介绍 end--> 
      
      <!--相关课程-->
      <div class="kczx_dynamic mt10">
        <div class="kczx_title kczx_titlel">相关课程 </div>
        #foreach($data in $!form.courseList)
        <div class="course-item"> <a href="$!{form.domain}/course/detail/$!{data.courseId}" title="$!{data.courseName}" target="_blank" class="course-img"> <img src="$!{form.getImageUrl($!{data.coursePic})}"/> </a>
          <div class="course-msg">
            <p class="nowrap ellipsis"> <a href="$!{form.domain}/course/detail/$!{data.courseId}" title="$!{data.courseName}" target="_blank" class="fontsize14 link03">$!{data.courseName}</a> </p>
            <p class="fontsize14"> <span class="price free"> ￥$!{form.getPrice($!{data.curPrice})} </span> <span class="colord seperator">|</span> <span class="color9">$!{data.courseStudyNum}人学习</span> </p>
          </div>
        </div>
        #end
      </div>
      <!--相关课程 end--> 
    </div>
  </div>
  <div class="clear"></div>
</div>
<!--已加入购物车-->
<div id="shopcart" class="shopcart" >
<a href="javascript:void(0);" onClick="shopcart()"><div style="position:relative;float:right;top:5px;margin-right:5px;"> <img src="$!{form.domain}/images/closew.png"></div></a>
  <div class="suc">
  
    <div class="suctop">
      <div class="suctop01"> <img src="$!{form.domain}/images/zccg.png"/> </div>
      <div class="suctop02">
        <div class="suctop0201"> 课程已成功添加至购物车！ </div>
        <div class="suctop0202"> 购物车共有<span id="cartSize" style="font-size:16px;color:#FF6600"></span>套课程 合计 <span id="cartAmount" style="font-size:16px;color:#FF6600"></span>人民币 </div>
      </div>
    </div>
    <div class="sucbottom">
      <a href="$!{form.domain}/cart/list"> <div class="sucbottom01"> 去购物车结算 </div>
      <a href="javascript:void(0);" onClick="shopcart()"> <div class="sucbottom02"> 关闭此页 </div> </a>
    </div>
  </div>
</div>
<div id="div00"> </div>
<!--end已加入购物车-->

#parse("common/footer.html")
<script>
$(function(){
	
	$('#shopcartbtn').bind('click',(function(){
		if(!checkLogin()){
			window.location="$!{form.domain}/member/login?redirectURL=/course/detail/$!{form.course.courseId}";
			return false;
		}
		if(!addC('$!{form.course.courseId}',0)){
			alert("课程添加失败!")
			return false;
		}
    	$('#shopcart').show(100);
    	$('#div00').show();
    	$('body').css('overflow','hidden')
    	})
	)
	
	$('#div00').bind('click',function(){
		$(this).fadeOut(200)
		$('#shopcart').fadeOut(200)
		$('body').css('overflow','auto')
	})
})

function shopcart(){
	document.getElementById("shopcart").style.display="none";
	document.getElementById("div00").style.display="none";
	document.body.style.overflow = "scroll";
}
	
$(function(){
	$("#course-listt").mouseover(function(){
		$("#course-list").show();
		$(this).addClass("navitemhover");
		$("#course-brief").hide();
		$("#course-brieft").removeClass("navitemhover");
		$("#course-record").hide();
		$("#course-recordt").removeClass("navitemhover");
	})
	$("#course-brieft").mouseover(function(){
    	$("#course-list").hide();
    	$("#course-listt").removeClass("navitemhover");
    	$("#course-brief").show();
    	$(this).addClass("navitemhover");
    	$("#course-record").hide();
    	$("#course-recordt").removeClass("navitemhover");
	})
	
	$("#course-recordt").mouseover(function(){
    	$("#course-list").hide();
    	$("#course-listt").removeClass("navitemhover");
    	$("#course-brief").hide();
    	$("#course-brieft").removeClass("navitemhover");
    	$("#course-record").show();
    	$(this).addClass("navitemhover");
	})
})

var checkLogin = function(){
	var flag = false;
	var _url='/member/user-cache';
	jQuery.ajax({
		type: "GET",
		url: _url,
		dataType: "json",
		async:false,
		success: function(data){
			if(data && data.drmUser  && data.drmUser.m && data.drmUser.u ){
				flag = true;
			}
		}
	})
	return flag;
}

var addC = function(courseId, type){
	var flag = false;
	var _url='$!{form.domain}/cart/addCart/' + type + "/" + courseId;
	jQuery.ajax({
		type: "GET",
		url: _url,
		dataType: "json",
		async:false,
		success: function(data){
			if(data && data.status=='200'){
				$("#cartSize").html(data.size)
				$("#shoppingCarCount").html(data.size)
				$("#cartAmount").html(data.amount)
				flag = true;
			}
		}
	})
	return flag;
}

var addCart = function(courseId, type){
	var _url='$!{form.domain}/cart/add/' + type + "/" + courseId;
	$("#course_submit").attr("action", _url);
	$("#course_submit").submit();
}
var nowStudy = function(courseId){
	var _url='$!{form.domain}/course/nowstudy/' +  courseId;
	$("#course_submit").attr("action", _url);
	$("#course_submit").submit();
}

var goToSignUp = function(courseId){
	var _url='$!{form.domain}/course/signup/' + courseId;
	jQuery.ajax({
		type: "GET",
		url: _url,
		dataType: "json",
		async:false,
		success: function(data){
			if(data && data.status=='200'){
				$('#shopcart').show(100);
				$(".suctop0201").html('课程已成功报名，管理员会通过邮件联系');
				$(".suctop0202").hide();
				$(".sucbottom01").hide();
	    		$('#div00').show();
	    		$('body').css('overflow','hidden')
			}
		}
	})
}
</script>
</body>
</html>